Skip to content

BUG: DataFrame.explode is failing on scalar int value. #43324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

BUG: DataFrame.explode is failing on scalar int value. #43324

wants to merge 1 commit into from

Conversation

shubh242
Copy link

@shubh242 shubh242 commented Aug 31, 2021

closes #43314

The int datatype of the column was raising this issue.

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

The **int** datatype of the column was raising this issue.
@@ -8271,7 +8271,7 @@ def explode(

columns: list[str | tuple]
if is_scalar(column) or isinstance(column, tuple):
assert isinstance(column, (str, tuple))
assert isinstance(column, (str, tuple, int))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add tests first

We should check for scalar values

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually i would remove the assert entirely i think (but agreed on tests), e.g. you can in theory have a datetime here as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes hence the scalar idea, but yeah removing is ok too

@jreback jreback added this to the 1.4 milestone Aug 31, 2021
@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Aug 31, 2021
@jreback jreback changed the title This change can solve this issue #43314 BUG: DataFrame.explode is failing on scalar int value. Aug 31, 2021
@simonjayhawkins simonjayhawkins added the Regression Functionality that used to work in a prior pandas version label Aug 31, 2021
@simonjayhawkins simonjayhawkins modified the milestones: 1.4, 1.3.3 Aug 31, 2021
@jreback
Copy link
Contributor

jreback commented Sep 1, 2021

@shubh242 can you aslo add a whatsnew note in 1.3.3, put in the bug fix reshaping section is ok

@simonjayhawkins
Copy link
Member

put in the bug fix reshaping section is ok

@shubh242 in the 1.3.x release notes we don't have the subsections. so just add to the regressions section.

@phofl
Copy link
Member

phofl commented Sep 8, 2021

@shubh242 are you interested in continuing?

@shubh242
Copy link
Author

shubh242 commented Sep 8, 2021

@shubh242 are you interested in continuing?

Yes i would like to give it another try. Can you be specific about what is failing by doing the change.

@phofl
Copy link
Member

phofl commented Sep 8, 2021

Please adress the review comments above

@simonjayhawkins
Copy link
Member

@shubh242 this PR is not yet ready (needs release note and tests) and planning a release tomorrow, moving to 1.3.4 milestone.

@simonjayhawkins simonjayhawkins modified the milestones: 1.3.3, 1.3.4 Sep 11, 2021
@jreback
Copy link
Contributor

jreback commented Sep 23, 2021

@shubh242 if you can update to comments and merge master

@jreback
Copy link
Contributor

jreback commented Sep 29, 2021

superseded by #43802

@jreback jreback closed this Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Regression Functionality that used to work in a prior pandas version Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.explode is failing on scalar int value.
4 participants